package com.itheima.fengkuanglianxi.bookmanager.bookmanagerentry;

import com.itheima.fengkuanglianxi.bookmanager.bookcontroller.BaseBookController;
import com.itheima.fengkuanglianxi.bookmanager.bookcontroller.Book2Controller;
import com.itheima.fengkuanglianxi.bookmanager.bookcontroller.BookController;

import java.util.Random;

public class BookManagerEntry {

    public static void main(String[] args) {

//        BookController bookController = new BookController();

//        bookController.start();
        BaseBookController bookController = getBookController();
        bookController.start();


    }

    public static BaseBookController getBookController(){
        Random r = new Random();
        int i = r.nextInt(2);
        switch (i){
            case 0:
                return new BookController();

            case 1:
                return new Book2Controller();
        }
        return null;
    }

}
